//+-+-+-+-+
//|N|C|O|M|
//+-+-+-+-+---------------------------- Copyright 2009 scott a dixon [archxs] -+
//|                                                                            |
//| This file is part of the NanoCOM project <http://code.google.com/p/ncom/>. |
//|                                                                            |
//| Nano COM is free software: you can redistribute it and/or modify           |
//| it under the terms of the GNU Lesser General Public License as published   |
//| by the Free Software Foundation, either version 3 of the License, or       |
//| (at your option) any later version.                                        |
//|                                                                            |
//| Nano COM is distributed in the hope that it will be useful,                |
//| but WITHOUT ANY WARRANTY; without even the implied warranty of             |
//| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              |
//| GNU Lesser General Public License for more details.                        |
//|                                                                            |
//| You should have received a copy of the GNU General Public License          |
//| along with the Nano COM source.  If not, see                               |
//| <http://www.gnu.org/licenses/>.                                            |
//|                                                                            |
//+----------------------------------------------------------------------------+
#ifndef NCOMOBJ_H_
#define NCOMOBJ_H_

//+----------------------------------------------------------------------------+
//| INCLUDES                                                                   |
//+----------------------------------------------------------------------------+
#include "platform.h"

//+----------------------------------------------------------------------------+
//| CLASS                                                                      |
//+----------------------------------------------------------------------------+
class NComObj : public IUnknown
{
    //+------------------------------------------------------------------------+
    //| DATA MEMBERS                                                           |
    //+------------------------------------------------------------------------+
    private: volatile ULONG _ref;

    //+------------------------------------------------------------------------+
    //| LIFECYCLE                                                              |
    //+------------------------------------------------------------------------+
    public: NComObj():_ref(0){};

    //+------------------------------------------------------------------------+
    //| IUnknown                                                               |
    //+------------------------------------------------------------------------+
    public: ULONG addRef()
    {
        return ++(this->_ref);
    };
    public: ULONG release()
    {
        return this->_ref--;
    };
    public: HRESULT QueryInterface(IID& riid, void **ppvObject)
    {
        return S_OK;
    };

};

#endif /* NCOMOBJ_H_ */
